package operateur;

/**
 * Interface definition : GestionColis
 * 
 * @author OpenORB Compiler
 */
public class _GestionColisStub extends org.omg.CORBA.portable.ObjectImpl
        implements GestionColis
{
    static final String[] _ids_list =
    {
        "IDL:operateur/GestionColis:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = operateur.GestionColisOperations.class;

    /**
     * Operation deposer
     */
    public operateur.Rep_DepotInitial deposer(String idDeposant, String idDestinataire, String idStation)
        throws operateur.Err_SoldeInsuffisant, operateur.Err_Zone
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("deposer",true);
                    operateur.identHelper.write(_output,idDeposant);
                    operateur.identHelper.write(_output,idDestinataire);
                    operateur.zoneHelper.write(_output,idStation);
                    _input = this._invoke(_output);
                    operateur.Rep_DepotInitial _arg_ret = operateur.Rep_DepotInitialHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(operateur.Err_SoldeInsuffisantHelper.id()))
                    {
                        throw operateur.Err_SoldeInsuffisantHelper.read(_exception.getInputStream());
                    }

                    if (_exception_id.equals(operateur.Err_ZoneHelper.id()))
                    {
                        throw operateur.Err_ZoneHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("deposer",_opsClass);
                if (_so == null)
                   continue;
                operateur.GestionColisOperations _self = (operateur.GestionColisOperations) _so.servant;
                try
                {
                    return _self.deposer( idDeposant,  idDestinataire,  idStation);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation confirmationDepot
     */
    public float confirmationDepot(operateur.codeRFID RFID_Colis)
        throws operateur.Err_CodeRFID_Inexistant
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("confirmationDepot",true);
                    operateur.codeRFIDHelper.write(_output,RFID_Colis);
                    _input = this._invoke(_output);
                    float _arg_ret = operateur.soldeHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(operateur.Err_CodeRFID_InexistantHelper.id()))
                    {
                        throw operateur.Err_CodeRFID_InexistantHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("confirmationDepot",_opsClass);
                if (_so == null)
                   continue;
                operateur.GestionColisOperations _self = (operateur.GestionColisOperations) _so.servant;
                try
                {
                    return _self.confirmationDepot( RFID_Colis);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation accepterTransport
     */
    public String accepterTransport(operateur.codeRFID RFID_Colis, String idTransporteur)
        throws operateur.Err_TransportAllreadyValidate
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("accepterTransport",true);
                    operateur.codeRFIDHelper.write(_output,RFID_Colis);
                    operateur.identHelper.write(_output,idTransporteur);
                    _input = this._invoke(_output);
                    String _arg_ret = operateur.codeRetraitHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(operateur.Err_TransportAllreadyValidateHelper.id()))
                    {
                        throw operateur.Err_TransportAllreadyValidateHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("accepterTransport",_opsClass);
                if (_so == null)
                   continue;
                operateur.GestionColisOperations _self = (operateur.GestionColisOperations) _so.servant;
                try
                {
                    return _self.accepterTransport( RFID_Colis,  idTransporteur);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation demandeRetraitTransporteur
     */
    public operateur.codeRFID demandeRetraitTransporteur(String codeTransporteur)
        throws operateur.Err_CodeRetrait
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("demandeRetraitTransporteur",true);
                    operateur.codeRetraitHelper.write(_output,codeTransporteur);
                    _input = this._invoke(_output);
                    operateur.codeRFID _arg_ret = operateur.codeRFIDHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(operateur.Err_CodeRetraitHelper.id()))
                    {
                        throw operateur.Err_CodeRetraitHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("demandeRetraitTransporteur",_opsClass);
                if (_so == null)
                   continue;
                operateur.GestionColisOperations _self = (operateur.GestionColisOperations) _so.servant;
                try
                {
                    return _self.demandeRetraitTransporteur( codeTransporteur);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getListeColisEnAttenteDeDepot
     */
    public operateur.codeRFID[] getListeColisEnAttenteDeDepot(String IDTransporteur, String IDStation)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getListeColisEnAttenteDeDepot",true);
                    operateur.identHelper.write(_output,IDTransporteur);
                    operateur.zoneHelper.write(_output,IDStation);
                    _input = this._invoke(_output);
                    operateur.codeRFID[] _arg_ret = operateur.listRFIDHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getListeColisEnAttenteDeDepot",_opsClass);
                if (_so == null)
                   continue;
                operateur.GestionColisOperations _self = (operateur.GestionColisOperations) _so.servant;
                try
                {
                    return _self.getListeColisEnAttenteDeDepot( IDTransporteur,  IDStation);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation retraitColis
     */
    public operateur.codeRFID retraitColis(String idUtilisateur, String idStation)
        throws operateur.Err_NoColis
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("retraitColis",true);
                    operateur.identHelper.write(_output,idUtilisateur);
                    operateur.zoneHelper.write(_output,idStation);
                    _input = this._invoke(_output);
                    operateur.codeRFID _arg_ret = operateur.codeRFIDHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(operateur.Err_NoColisHelper.id()))
                    {
                        throw operateur.Err_NoColisHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("retraitColis",_opsClass);
                if (_so == null)
                   continue;
                operateur.GestionColisOperations _self = (operateur.GestionColisOperations) _so.servant;
                try
                {
                    return _self.retraitColis( idUtilisateur,  idStation);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getListeColisClient
     */
    public operateur.InfoColis[] getListeColisClient(String idUtilisateur)
        throws operateur.Err_NoColis
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getListeColisClient",true);
                    operateur.identHelper.write(_output,idUtilisateur);
                    _input = this._invoke(_output);
                    operateur.InfoColis[] _arg_ret = operateur.listColisHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(operateur.Err_NoColisHelper.id()))
                    {
                        throw operateur.Err_NoColisHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getListeColisClient",_opsClass);
                if (_so == null)
                   continue;
                operateur.GestionColisOperations _self = (operateur.GestionColisOperations) _so.servant;
                try
                {
                    return _self.getListeColisClient( idUtilisateur);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation depotApresTransport
     */
    public void depotApresTransport(operateur.codeRFID colisDepose)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("depotApresTransport",false);
                    operateur.codeRFIDHelper.write(_output,colisDepose);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("depotApresTransport",_opsClass);
                if (_so == null)
                   continue;
                operateur.GestionColisOperations _self = (operateur.GestionColisOperations) _so.servant;
                try
                {
                    _self.depotApresTransport( colisDepose);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation confirmationRetraitColis
     */
    public void confirmationRetraitColis(operateur.codeRFID colisRetire)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("confirmationRetraitColis",false);
                    operateur.codeRFIDHelper.write(_output,colisRetire);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("confirmationRetraitColis",_opsClass);
                if (_so == null)
                   continue;
                operateur.GestionColisOperations _self = (operateur.GestionColisOperations) _so.servant;
                try
                {
                    _self.confirmationRetraitColis( colisRetire);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
